package com.cljh.mapper;


import com.cljh.bean.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface RoleMapper {
    @Insert("insert into mtmall_test.sys_role ( name, description,sys_role.key) values (#{role.name},#{role.description},#{role.key});")
    int save(@Param("role") Role role);

    @Delete("delete from mtmall_test.sys_role where id=#{id};")
    int delete(Integer id);

    int Upd(@Param("role") Role role);

    @Select("select * from mtmall_test.sys_role where id=#{id};")
    Role selectById(Integer id);



    List<Role> selectAll(@Param("begin")Integer begin, @Param("size")Integer size, @Param("role")Role role);

    int selectCount(@Param("role")Role role);

    int deleteIds(@Param("ids") List<Integer> ids);


    @Select("select * from mtmall_test.sys_role;")
    List<Role> selectAll1();


    @Select("select * from mtmall_test.sys_role where sys_role.key=#{key} ;")
    Role selectByKey(@Param("key")String key);
}
